package formulation;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import es.deusto.ingenieria.is.csp.formulation.Variable;

public class Letter extends Variable<Integer> {

	private Hashtable<Integer, ArrayList<Integer>> locations;

	public Letter(String name, List<Integer> domain) {
		super(name, domain);
		locations = new Hashtable<Integer, ArrayList<Integer>>();
	}

	public Hashtable<Integer, ArrayList<Integer>> getLocations() {
		return locations;
	}

	public void addLocation(Integer column, Integer opNum, Integer result) {
		ArrayList<Integer> arrayNumeros = new ArrayList<Integer>();
		arrayNumeros.add(opNum);
		arrayNumeros.add(result);
		locations.remove(column);
		locations.put(column, arrayNumeros);
	}

	@Override
	public String toString() {
		String cadena = getName() + " = " + getValue();
		return cadena;
	}

}
